﻿@using BusinessBingo.Web.Helpers;
@using Combres.Mvc;

@{
    ViewBag.Title = " - Multiplayer";
}

@section Scripts {
<script src="@Html.CombresUrl("mvcAjaxJs")"></script>
<script type="text/javascript">

    function onCreateGroupComplete(result) {
        var obj = $.parseJSON(result.responseText);
        var urlTxt = $('#url');
        urlTxt.val(obj.Url);
        urlTxt.select();

        $('#goToGroupBtn').click(function () {
            location.href = obj.Url;
        });
    };
    
</script>
}

	<div class="box-12-expand">
		<div class="box-12">
            <div class="normalBox">
                <h1>@Resources.Multiplayer.Headline</h1>
                <div class="box-5">
                @using (Ajax.BeginForm("Create", "Group", new AjaxOptions() { OnComplete = "onCreateGroupComplete" }))
                {
						<h2>@Resources.Global.Step 1:</h2>
						<p>
							@Resources.Multiplayer.CreateGroupDescription
						</p>
						<p>
							<input class="width-5"  id="name" name="name"  type="text" />
						</p>
						<p>
							<button class="width-5"> @Resources.Multiplayer.CreateGroup </button>
						</p>
                }
                </div>
                <div class="box-5">
						<h2>@Resources.Global.Step 2:</h2>
						<p>
						    @Resources.Multiplayer.ShareLink
						</p>
						<p>
							<input class="width-5" readonly="readonly" id="url" type="text" />
						</p>
						<p>
							<button class="width-5" id="goToGroupBtn"> @Resources.Multiplayer.GoToGroup </button>
						</p>
                </div>
            </div>
		</div>
		
	</div>
